//初始化加载数据
var page = 1;
//分页加载 上拉加载是执行此方法
$(window).scroll(function() {

    if ($(window).scrollTop()+$(window).height() > $(document).height()-1) {
        console.log("已经滑动到底部!");
        getRecordList(++page);
    }
});

var getRecordList = function (page) {

    $.ajax({
        type: "get",
        url: "",
        data: {
            page: page
        },
        dataType: "json",
        success:function (res) {
            var data = res.data;
            if(res['msg'] = "成功") {
                if (data.length > 0) {
                    for (var i = 0; i <data.length; i++) {
                        var li = '<li><a href="'+data[i].jump_url+'"><span>'+data[i].patient_case_type_name+'</span><span>'+data[i].patient_part_lat_name+'</span><span>'+res.data[i].check_time+'</span></a></li>';
                        $("#recordList").append(li);
                    }
                }
            }
        }, error: function (e) {

        }
    });
}